#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
const int N = 1005;

int n, m;
int w[] = {0, 1, 2, 3, 5, 10, 20};
int v[N], tot;
int dp[N];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  rep(i, 1, 6) {
    int x;
    cin >> x;
    for (int j = 1; j <= x; j <<= 1) {
      v[++tot] = w[i] * j;
      x -= j;
    }
    if (x) v[++tot] = w[i] * x;
  }
  int mx = accumulate(v + 1, v + tot + 1, 0);
  dp[0] = 1;
  rep(i, 1, tot) {
    per(j, mx, v[i]) {
      if (dp[j - v[i]]) dp[j] = 1;
    }
  }
  int ans = 0;
  rep(i, 1, mx) if (dp[i]) ans++;
  cout << "Total=" << ans;
  return 0;
}